package com.foruo.demo.redis.pubsub;

import redis.clients.jedis.Jedis;

/**
 * 发布者
 * @author GaoYuan
 * @date 2018/9/17 下午9:06
 */
public class Publisher {
    public static void main(String[] args){
        Jedis jedis = null;
        try {
            jedis = new Jedis(JedisConfig.HOST, JedisConfig.PORT);
            jedis.publish("channel1", "你好，我是foruo！");
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if (jedis != null) {
                jedis.close();
            }
        }
    }
}
